import request from '@/router/axios';
import {baseUrl} from '@/config/env';

export const getList = (params) => {
  return request({
    url: baseUrl + '/api/Organize/getpages',
    method: 'get',
    params: {
      key:params.name==undefined?'':params.name,
      type:params.parentId==undefined?'':params.parentId,
      limit:params.limit==undefined?'':params.limit
    }
  })
}
export const remove = (ids) => {
  return request({
    url: baseUrl + '/api/Organize/remove',
    method: 'post',
    params: {
      ids,
    }
  })
}

export const add = (row) => {
  return request({
    url: baseUrl + '/api/Organize/add',
    method: 'post',
    data: row
  })
}

export const update = (row) => {
  return request({
    url: baseUrl + '/api/Organize/edit',
    method: 'post',
    data: row
  })
}

export const getDept = (id) => {
  return request({
    url: baseUrl + '/api/Organize/detail',
    method: 'get',
    params: {
      id,
    }
  })
}
export const getDeptTree = (tenantCode) => {
  return request({
    url: baseUrl + '/api/Organize/gettree',
    method: 'get',
    params: {
      tenantCode,
    }
  })
}

